import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../views/Login.vue'
import Test from '../components/Test/test.vue'
import WelCome from '../views/WelCome.vue'
import User from '../components/User/user.vue'
import Role from '../components/Role/role.vue'
import Privilege from '../components/Privilege/privilege.vue'
import Role_privilege from '../components/Role_privilege/role_privilege'
import Category from '../components/Category/category.vue'
import Discount from '../components/Discount/discount.vue'
import Ware from '../components/Ware/ware.vue'
Vue.use(VueRouter)

const routes = [
    { path: '/', redirect: '/login', name: "登录页面" },
    { path: '/login', component: Login, name: "登录模块" },
    {
        path: '/home',
        component: Home,
        redirect: '/welcome',
        name: "初始模块",
        children: [{
            path: '/welcome',
            component: WelCome,
            name: "首页面"
        }]
    },
    // 测试模块
    {
        path: '/one',
        component: Home,
        name: "测试模块",
        children: [{
            path: '/test',
            component: Test,
            name: "测试模块"
        }]
    },
    // 用户模块
    {
        path: '/two',
        component: Home,
        name: "用户管理",
        children: [{
            path: '/user',
            component: User,
            name: "用户列表"
        }]
    },
    // 角色模块
    {
        path: '/three',
        component: Home,
        name: "角色模块",
        children: [{
            path: '/role',
            component: Role,
            name: "角色管理"
        }]
    },
    // 权限模块
    {
        path: '/four',
        component: Home,
        name: "权限模块",
        children: [{
            path: '/privilege',
            component: Privilege,
            name: "权限管理"
        }]
    },
    // 角色权限模块
    {
        path: '/five',
        component: Home,
        name: "角色权限模块",
        children: [{
            path: '/role_privilege',
            component: Role_privilege,
            name: "角色权限管理"
        }]
    },
    // 分类模块
    {
        path: '/six',
        component: Home,
        name: "商品分类模块",
        children: [{
            path: '/category',
            component: Category,
            name: "商品分类管理"
        }]
    },
    // 折扣模块
    {
        path: '/seven',
        component: Home,
        name: "商品折扣模块",
        children: [{
            path: '/discount',
            component: Discount,
            name: "商品折扣管理"
        }]
    },
    // 热卖商品模块
    {
        path: '/eight',
        component: Home,
        name: "热卖商品模块",
        children: [{
            path: '/ware',
            component: Ware,
            name: "热卖商品管理"
        }]
    },
]

const router = new VueRouter({
    routes
})

export default router